package com.hmc.modules.sjfx.service.tmm0001.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hmc.common.service.impl.CrudServiceImpl;
import com.hmc.common.constant.Constant;
import com.hmc.modules.sjfx.dao.tmm0001.Tmm0001Dao;
import com.hmc.modules.sjfx.dto.sjfx.SaleOrderSupplierDTO;
import com.hmc.modules.sjfx.dto.sjfx.SphAndWglhDTO;
import com.hmc.modules.sjfx.dto.tmm0001.Tmm0001DTO;
import com.hmc.modules.sjfx.entity.tmm0001.Tmm0001Entity;
import com.hmc.modules.sjfx.service.tmm0001.Tmm0001Service;
import com.hmc.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toCollection;

/**
 * 材料库存表
 *
 * @author hmc wengxiulinluman@qq.com
 * @since 3.0 2024-01-12
 */
@Service
public class Tmm0001ServiceImpl extends CrudServiceImpl<Tmm0001Dao, Tmm0001Entity, Tmm0001DTO> implements Tmm0001Service {

    @Autowired
    private Tmm0001Dao tmm0001Dao;


    @Override
    public QueryWrapper<Tmm0001Entity> getWrapper(Map<String, Object> params){
        QueryWrapper<Tmm0001Entity> wrapper = new QueryWrapper<>();


        return wrapper;
    }


    /**
     * 查询管号SALE_ORDER_SUB_NO和供应商SUPPLIER_NAME
     * @return
     */
    @Override
    public List<SaleOrderSupplierDTO> querySaleOrderSubAndSupplier() {
        List<SaleOrderSupplierDTO> saleOrderSupplierDTOS = tmm0001Dao.querySaleOrderSubAndSupplier();
//        List<SaleOrderSupplierDTO> collect = saleOrderSupplierDTOS.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(SaleOrderSupplierDTO::getSaleOrderSubNo))), ArrayList::new));
        return saleOrderSupplierDTOS;
    }
}